<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div>
    <h1>
      <span class="child">span元素</span>
    </h1>
  </div>
  <script>
    var child = document.querySelector('.child');
    console.log(child.parentNode); 
  </script>
</body>
</html>